package cn.edu.zafu.bigdata.XuShuXin;

public class CeShi {
    public static void main(String[] args) {
        System.out.println("连接成功");

        // 第一题  继承 重写
        xushuxin_Animal xAni = new xushuxin_Animal();
        xAni.makeSound();

        xushuxin_Dog xDog = new xushuxin_Dog();
        xDog.makeSound();

        xushuxin_Cat xCat = new xushuxin_Cat();
        xCat.makeSound();

        System.out.println();

        //第二题  重载
        xushuxin_chongzai xCz = new xushuxin_chongzai();
        xCz.add(2 , 5);
        xCz.add(2.0, 5.0);
        xCz.add(2, 5, 8);

        System.out.println();

        //第三题  toString
        xushuxin_Book xBook = new xushuxin_Book("Java", "xushuxin", 28.88);
        System.out.println(xBook.toString());

        System.out.println();

        //第四题  多态
        xushuxin_Vehicle[] xVehicle = new xushuxin_Vehicle[3];
        xVehicle[0] = new xushuxin_Vehicle();
        xVehicle[1] = new xushuxin_Car();
        xVehicle[2] = new xushuxin_Bicycle();


        for (int i = 0; i < xVehicle.length; i ++){
            xVehicle[i].move();
        }

    }
}
